ScreenEvent = RegisterEvents{
    "CoverAll"
}
Screen = {
    props = {
        _coverAll = true
    },
    gets = {
        coverAll = function (self)
            return self._coverAll
        end
    },
    sets = {
        coverAll = function (self, key, val)
            self._coverAll = val
            self:emit(ScreenEvent.CoverAll, val)
        end
    },
    dependencies = {
        Stretch, Align
    }
}

function Screen:ctor()
    self:addTo(Layer.UI)
end

function Node.Screen()
    local screen = Node.new():addComponent(Screen)
    local content = Node.new():addComponent(Stretch):addComponent(Layout):addTo(screen)
    screen.screenContent = content
    local top = Node.new():addComponent(Stretch):addTo(screen)
    screen.screenTop = top
    return screen
end